home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_iceboss.cog < prev    next >
Text File  |  1999-11-15  |  16KB  |  663 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHW_IceBoss.cog
  4. #
  5. # AI enhancements for Ice Boss
  6. #
  7. # [MDR]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. # ===================================================================
  14. symbols
  15.  
  16. message        arrivedwpnt
  17. message        aievent
  18. message        entered
  19. message        exited
  20. message        damaged
  21. message        timer
  22. message        user0
  23. message        user1
  24.  
  25. # *********************** SUBROUTINES **************************
  26. flex        Begin_GuardMarch            local
  27. flex        End_GuardMarch                local
  28. flex        Set_WallGuardMode            local
  29.  
  30. # ************************** LINKED ITEMS **********************
  31. thing        t_wpnt00
  32. thing        t_wpnt01
  33. thing        t_wpnt02
  34. thing        t_wpnt03
  35. thing        t_wpnt04
  36. thing        t_wpnt05
  37. thing        t_wpnt06
  38. thing        t_wpnt07
  39. thing        t_wpnt08
  40. thing        t_wpnt09
  41. thing        t_wpnt10
  42. thing        t_wpnt11
  43. thing        t_wpnt12
  44. thing        t_wpnt13
  45. thing        t_wpnt14
  46. thing        t_wpnt15
  47. thing        t_wpnt16
  48. thing        t_wpnt17
  49. thing        t_wpnt18
  50. thing        t_wpnt19
  51. thing        t_wpnt20
  52. thing        t_wpnt21
  53. thing        t_wpnt22
  54. thing        t_wpnt23
  55.  
  56. int            n_wpnts=24                    local
  57.  
  58. sector        sec_trigger00    linkid=1
  59. sector        sec_trigger01    linkid=1
  60. sector        sec_trigger02    linkid=1
  61. sector        sec_trigger03    linkid=1
  62. sector        sec_trigger04    linkid=1
  63. sector        sec_trigger05    linkid=1
  64. sector        sec_trigger06    linkid=1
  65. sector        sec_trigger07    linkid=1
  66. sector        sec_trigger08    linkid=1
  67. sector        sec_trigger09    linkid=1
  68. sector        sec_trigger10    linkid=1
  69. sector        sec_trigger11    linkid=1
  70. sector        sec_trigger12    linkid=1
  71. sector        sec_trigger13    linkid=1
  72. sector        sec_trigger14    linkid=1
  73. sector        sec_trigger15    linkid=1
  74. sector        sec_trigger16    linkid=1
  75. sector        sec_trigger17    linkid=1
  76.  
  77. # ************************** TEMPLATES *************************
  78. template    tpl_Boss=ice_boss            local
  79.  
  80. # ************************** MISC LOCAL VARS *******************
  81. cog            cog_cinematic                local                # ref to COG who called us
  82. thing        t_boss=-1                    local
  83. thing        t_player                    local
  84. thing        t_sender                    local
  85.  
  86. int            n_imp1Hits                    local
  87. int            TIMERID_DEATH=1                local
  88. int            TIMERID_IMPHIT=2            local
  89. int            TIMERID_MARCH=3                local
  90. int            TIMERID_IMPHURT=4            local
  91.  
  92. int            n_crntWpnt                    local
  93. int            n_nextWpnt                    local
  94. int            n_marchToWpnt                local
  95. int            b_goNow                        local
  96.  
  97. int            b_lockMotion                local
  98.  
  99. int            n_event                        local
  100. int            n_crntAIMode                local
  101. int            n_param                        local
  102.  
  103. float        f_val                        local
  104. vector        vec_pos                        local
  105.  
  106. int            b_testmode=0                local
  107.  
  108. end
  109.  
  110.  
  111. # ===================================================================
  112. code
  113.  
  114. # ...................................................................
  115. aievent:
  116.  
  117.     if ( GetSenderRef() != t_boss ) return;
  118.  
  119.     n_event            = GetParam(0);
  120.     n_crntAIMode    = GetParam(1);
  121.     n_param            = GetParam(2);                            # Value depends on n_event
  122.  
  123.     if (n_event == 0x100)                                    #---- EVENT_MODECHANGED
  124.     {                                                        #---- n_param == old AI mode
  125.  
  126.         if ( !BITTEST(n_param, 0x2) && BITTEST(n_crntAIMode, 0x2) )
  127.         {                                                        # Switched to MODE_ATTACKING?
  128. #            DEBUGPRINT("AIEVENT:: Switched to ATTACK mode");
  129.             KillTimerEx(TIMERID_MARCH);
  130.         }
  131.         else if ( !BITTEST(n_param, 0x4) && BITTEST(n_crntAIMode, 0x4) )
  132.         {                                                        # Switched to MODE_SEARCHING?
  133. #            DEBUGPRINT("AIEVENT:: Switched to SEARCH mode");
  134.  
  135.             KillTimerEx(TIMERID_MARCH);
  136.             SetTimerEx(0.1, TIMERID_MARCH, 0, 0);
  137.         }
  138.         else if ( !BITTEST(n_param, 0x200000) && BITTEST(n_crntAIMode, 0x200000) )
  139.         {                                                        # Switched to MODE_WALLCRAWL?
  140. #            DEBUGPRINT("AIEVENT:: Switched to wallcrawl mode");
  141.  
  142.             SetArmedMode(t_boss, 2);                            # Disable roll attack
  143.             AISetSubMode(t_boss, 0x20);                            # Set SUBMODE_SKIPCHECKFIREFOV
  144.         }
  145.         else if ( BITTEST(n_param, 0x200000) && !BITTEST(n_crntAIMode, 0x200000) )
  146.         {                                                        # Switched out of MODE_WALLCRAWL?
  147. #            DEBUGPRINT("AIEVENT:: Switched out of wallcrawl mode");
  148.  
  149.             SetArmedMode(t_boss, 1);                            # Enable roll attack
  150.             AIClearSubMode(t_boss, 0x20);                        # Clear SUBMODE_SKIPCHECKFIREFOV
  151.         }
  152.     }
  153.     else if ( BITTEST(n_event, 0x100200) )                    #---- EVENT_HIT(WALL|FLOOR) ----
  154.     {
  155.         if ( AIGetArmedMode(t_boss) == 0 )
  156.             return;
  157.  
  158.         b_lockMotion = 0;
  159.  
  160.         if ( (n_crntWpnt==0 && n_nextWpnt==8) || (n_crntWpnt==2 && n_nextWpnt==10) )
  161.         {
  162.             # Dont lock if not wall crawling yet
  163.             if ( !BITTEST(AIGetMode(t_boss), 0x200000) )
  164.                 return;
  165.  
  166.             b_lockMotion = 1;
  167.         }
  168.         if ( (n_crntWpnt==10 && n_nextWpnt==2) || (n_crntWpnt==8 && n_nextWpnt==0) )
  169.         {
  170.             # Dont lock if HITFLOOR
  171.             if ( BITTEST(n_event, 0x100000) )
  172.                 return;
  173.  
  174.             b_lockMotion = 1;
  175.         }
  176.         if ( (n_crntWpnt==12 && n_nextWpnt==17) || (n_crntWpnt==17 && n_nextWpnt==12) )
  177.         {
  178.             b_lockMotion = 1;
  179.         }
  180.         if ( (n_crntWpnt==20 && n_nextWpnt==16) || (n_crntWpnt==16 && n_nextWpnt==20) )
  181.         {
  182.             b_lockMotion = 1;
  183.         }
  184.         if ( (n_crntWpnt==16 && n_nextWpnt==12) || (n_crntWpnt==12 && n_nextWpnt==16) )
  185.         {
  186.             b_lockMotion = 1;
  187.         }
  188.         if ( (n_crntWpnt==20 && n_nextWpnt==18) || (n_crntWpnt==18 && n_nextWpnt==20) )
  189.         {
  190.             b_lockMotion = 1;
  191.         }
  192.         if ( (n_crntWpnt==5 && n_nextWpnt==23) || (n_crntWpnt==23 && n_nextWpnt==5) )
  193.         {
  194.             b_lockMotion = 1;
  195.         }
  196.  
  197.         if ( b_lockMotion == 1 )
  198.         {
  199.             AISetSubmode(t_boss, 0x8000000);                    # Set SUBMODE_WALLCRAWLLOCKED
  200.             SetThingMoveSize(t_boss, 0.15);
  201.             ReturnEx(1);
  202.         }
  203.     }
  204.  
  205.     return;
  206.  
  207.  
  208. # ...................................................................
  209. timer:
  210.  
  211.     if ( t_boss == -1 )
  212.         return;
  213.  
  214.     #***  Start marching Timer  ***#
  215.     if ( GetSenderID() == TIMERID_MARCH )
  216.     {
  217. #        KillTimerEx(TIMERID_MARCH);
  218.  
  219.         # Wall mount transistion in progress... try again later
  220.         if ( GetMoveStatus(t_boss) == 20 )
  221.         {
  222. #            DEBUGPRINT("TIMERID_MARCH:: waiting for climb transition");
  223.             SetTimerEx(1.0, TIMERID_MARCH, 0, 0);
  224.             return;
  225.         }
  226.         # Roll attack in progress... try again later
  227.         if ( AIGetArmedMode(t_boss) == 0 )
  228.         {
  229. #            DEBUGPRINT("TIMERID_MARCH:: waiting to end roll attack");
  230.             SetTimerEx(1.0, TIMERID_MARCH, 0, 0);
  231.             return;
  232.         }
  233.  
  234.         if ( n_marchToWpnt == -1 )
  235.         {
  236. #            DEBUGPRINT("TIMERID_MARCH:: no march to location");
  237.             AISetLookThingEyeLevel(t_boss, t_wpnt01);
  238.             return;
  239.         }
  240.  
  241.         #***  Clear to start marching  ***#
  242.         call Begin_GuardMarch;
  243.     }
  244.  
  245.  
  246.     #***  IMP1 HIT safety check timer  ***#
  247.     if ( GetSenderID() == TIMERID_IMPHIT )
  248.     {
  249.         #***  Make sure boss is on the arena floor before hit cutscene   ***#
  250.         if ( BITTEST(AIGetMode(t_boss), 0x200000) || (GetMoveStatus(t_boss) == 20) )
  251.         {
  252. #            DEBUGPRINT("SHW_IceBoss.cog (AI Cog) preping to send IMP HIT msg");
  253.             SetTimerEx(1.0, TIMERID_IMPHIT, 0, 0);
  254.             return;
  255.         }
  256.  
  257. #        DEBUGPRINT("TIMERID_IMPHURT:: HURT time started");
  258.         StopMode(t_boss, 65, 0.1);                                # Halt attack anim
  259.         SendMessage(cog_cinematic, USER0);                        # Notify cinematic COG of imp1 hit
  260.         SetActorFlags(t_boss, 0xC00);                            # Set AF_DEAF+BLIND
  261.  
  262.         SetTimerEx(8.0, TIMERID_IMPHURT, 0, 0);                    # Give Boss time to 'rest'
  263.     }
  264.  
  265.  
  266.     #***  HURT period ended Timer  ***#
  267.     if ( GetSenderID() == TIMERID_IMPHURT )
  268.     {
  269. #        DEBUGPRINT("TIMERID_IMPHURT:: HURT time elapsed");
  270.         ClearActorFlags(t_boss, 0xC00);                            # Clear AF_DEAF+BLIND
  271.         AISetFireTarget(t_boss, t_player);
  272.     }
  273.  
  274.  
  275.     #***  IMP1 DEATH safety check timer  ***#
  276.     if ( GetSenderID() == TIMERID_DEATH )
  277.     {
  278.         # Make sure boss is on the arena floor before death
  279.         if ( BITTEST(AIGetMode(t_boss), 0x200000) || (GetMoveStatus(t_boss) == 20) )
  280.         {
  281. #            DEBUGPRINT("SHW_IceBoss.cog (AI Cog) preping to send KILLED msg");
  282.             SetTimerEx(1.0, TIMERID_DEATH, 0, 0);
  283.             return;
  284.         }
  285.  
  286.         KillTimerEx(TIMERID_MARCH);
  287.  
  288.         StopMode(t_boss, 65, 0.1);                                        # Halt attack anim
  289.         SendMessage(cog_cinematic, KILLED);                                # Notify cinematic COG of boss death
  290.  
  291.         SendMessageEx(GetInvCog(t_player, 14), USER0, 0, 0, 0, 0);        # Reset IMP1 shot range
  292.  
  293.         ReleaseThing(t_boss);
  294.         t_boss = -1;
  295. #        DEBUGPRINT("SHW_IceBoss.cog (AI Cog) sending KILLED msg");
  296.     }
  297.  
  298.     return;
  299.  
  300.  
  301. # ...................................................................
  302. arrivedwpnt:
  303.  
  304.     n_crntWpnt = GetParam(0);
  305.     n_nextWpnt = GetParam(1);
  306.  
  307. #    DEBUGFLEX(n_crntWpnt, "Arrived Wpnt");
  308. #    DEBUGFLEX(n_nextWpnt, "Next Wpnt");
  309. #    DEBUGPRINT("---------");
  310.  
  311.     AIClearSubmode(t_boss, 0x8000000);                            # Clear SUBMODE_WALLCRAWLLOCKED
  312.     SetThingMoveSize(t_boss, 0.18);
  313.  
  314.     if ( (n_marchToWpnt == 1) && (n_crntWpnt >= 0 && n_crntWpnt <= 4) )
  315.     {
  316. #        DEBUGPRINT("Arrived at arena floor.  Clearing forced march.");
  317.         call End_GuardMarch;
  318.         return;
  319.     }
  320.  
  321.     if ( n_crntWpnt == n_marchToWpnt )
  322.     {
  323.         call End_GuardMarch;
  324.         call Set_WallGuardMode;
  325.     }
  326.  
  327.     return;
  328.  
  329.  
  330. # ...................................................................
  331. entered:
  332.  
  333.     if ( b_testmode==1 )
  334.         return;
  335.  
  336.     if ( t_boss == -1 )
  337.         return;
  338.  
  339.     if ( GetSenderID() != 1 )
  340.         return;
  341.  
  342.     t_sender = GetSenderRef();
  343.     b_goNow  = 0;
  344.     n_param  = -1;
  345.  
  346.     if ( (t_sender == sec_trigger00) || (t_sender == sec_trigger17) )
  347.     {
  348. #        DEBUGPRINT("Entered sector0 or 17");
  349.         n_param = 12;
  350.     }
  351.     else if ( t_sender == sec_trigger01 || t_sender == sec_trigger16 )
  352.     {
  353. #        DEBUGPRINT("Entered sector1 or 16");
  354.         n_param = 23;
  355.     }
  356.     else if ( t_sender == sec_trigger02 )
  357.     {
  358. #        DEBUGPRINT("Entered sector2");
  359.         n_param = 22;
  360.     }
  361.     else if ( t_sender == sec_trigger03 )
  362.     {
  363. #        DEBUGPRINT("Entered sector3");
  364.         n_param = 11;
  365.     }
  366.     else if ( t_sender == sec_trigger04 )            # First ground trig
  367.     {
  368. #        DEBUGPRINT("Entered sector4");
  369.         vec_pos = VectorSub(GetThingPos(t_player), GetThingPos(t_wpnt01));
  370.         if ( VectorZ(vec_pos) > 0.3 )
  371.         {
  372.             n_param = 19;
  373.             b_goNow = 1;
  374.         }
  375.         else
  376.         {
  377.             n_param = 1;
  378.         }
  379.     }
  380.     else if ( t_sender == sec_trigger05 )
  381.     {
  382. #        DEBUGPRINT("Entered sector5");
  383.         n_param = 1;
  384.     }
  385.     else if ( t_sender == sec_trigger06 )
  386.     {
  387. #        DEBUGPRINT("Entered sector6");
  388.         n_param = 1;
  389.     }
  390.     else if ( t_sender == sec_trigger07 )
  391.     {
  392. #        DEBUGPRINT("Entered sector7");
  393.         n_param = 1;
  394.     }
  395.     else if ( t_sender == sec_trigger08 )
  396.     {
  397. #        DEBUGPRINT("Entered sector8");
  398.         n_param = 1;
  399.     }
  400.     else if ( t_sender == sec_trigger09 )
  401.     {
  402. #        DEBUGPRINT("Entered sector9");
  403.         n_param = 1;
  404.     }
  405.     else if ( t_sender == sec_trigger10 )            # Last ground trig
  406.     {
  407. #        DEBUGPRINT("Entered sector10");
  408.         n_param = 1;
  409.     }
  410.     else if ( t_sender == sec_trigger11 )
  411.     {
  412. #        PRINT("Entered sector11");
  413.         n_param = 21;
  414.     }
  415.     else if ( t_sender == sec_trigger12 )
  416.     {
  417. #        PRINT("Entered sector12");
  418.         n_param = 13;
  419.     }
  420.     else if ( t_sender == sec_trigger13 )
  421.     {
  422. #        PRINT("Entered sector13");
  423.         n_param = 15;
  424.     }
  425.     else if ( t_sender == sec_trigger14 )
  426.     {
  427. #        PRINT("Entered sector14");
  428. #        n_param = 1;
  429.         n_param = 13;
  430.     }
  431.     else if ( t_sender == sec_trigger15 )
  432.     {
  433. #        PRINT("Entered sector15");
  434.         n_param = 7;
  435.         b_goNow = 1;
  436.     }
  437.  
  438.     if ( (n_param > -1) && (n_param != n_marchToWpnt) )
  439.     {
  440.         #***  Check for conditions to ignore trigger  ***#
  441.         if ( n_param == 1 )
  442.         {
  443.             # Ignore floor trigger in roll attack mode
  444.             if (AIGetArmedMode(t_boss) == 0)
  445.                 return;
  446.  
  447.             # Ignore floor trigger if not in WALLCRAWL mode
  448.             if ( !BITTEST(AIGetMode(t_boss), 0x200000) )
  449.                 return;
  450.         }
  451.  
  452.  
  453.         #***  Set the new march location  ***#
  454. #        DEBUGFLEX(n_param, "*** Setting march to");
  455.         n_marchToWpnt = n_param;
  456.  
  457.  
  458.         #***  Check conditions for immediate marching  ***#
  459.         # Go now flag set
  460.         if ( b_goNow == 1 )
  461.         {
  462. #            KillTimerEx(TIMERID_MARCH);
  463.             SetTimerEx(0.1, TIMERID_MARCH, 0, 0);
  464.         }
  465.  
  466.         # If SEARCHING, start moving now
  467.         if ( BITTEST(AIGetMode(t_boss), 0x04) )
  468.         {
  469. #            KillTimerEx(TIMERID_MARCH);
  470.             SetTimerEx(0.1, TIMERID_MARCH, 0, 0);
  471.         }
  472.  
  473.         # If FLEEING (ie, already marching), move to new pos now
  474.         if ( BITTEST(AIGetMode(t_boss), 0x800) )
  475.         {
  476. #            KillTimerEx(TIMERID_MARCH);
  477.             SetTimerEx(0.1, TIMERID_MARCH, 0, 0);
  478.         }
  479.  
  480.         # If WALLCRAWLING and player hit arena center, start moving now
  481.         if ( BITTEST(AIGetMode(t_boss), 0x200000) && (n_marchToWpnt==1) )
  482.         {
  483. #            KillTimerEx(TIMERID_MARCH);
  484.             SetTimerEx(0.1, TIMERID_MARCH, 0, 0);
  485.         }
  486.     }
  487.  
  488.     return;
  489.  
  490.  
  491. # ...................................................................
  492. exited:
  493.  
  494.     return;
  495.  
  496.  
  497. # ...................................................................
  498. damaged:
  499.  
  500.     n_param = GetParam(1);
  501.     if (n_param == 0x1000)                                    #---- SITH_DAMAGE_IMP1 ?
  502.     {
  503.         n_imp1Hits = n_imp1Hits + 1;
  504.         if ( n_imp1Hits < 3 )
  505.         {
  506.             SetTimerEx(0.1, TIMERID_IMPHIT, 0, 0);
  507.             return;
  508.         }
  509.  
  510.         SetActorFlags(t_boss, 0xC00);                            # Set DEAF and BLIND in prep for death
  511.         SetTimerEx(0.1, TIMERID_DEATH, 0, 0);
  512.     }
  513.  
  514.     return;
  515.  
  516.  
  517. # ...................................................................
  518. # Create an Ice Boss at location-THING == GetParam(0)        [must be a valid GHOST THING]
  519. user0:
  520.  
  521.     cog_cinematic    = GetSenderRef();                        # Remember who called us
  522.  
  523.     t_boss = CreateThing(tpl_Boss, GetParam(0));
  524.     CaptureThing(t_boss);
  525.  
  526.     ClearActorFlags(t_boss, 0x80000);                        # Make boss visible
  527.     AISetCutsceneMode(t_boss);                                # Put him into cutscene mode until further notice
  528.  
  529.     ReturnEx(t_boss);                                        # Return Boss THING index to caller
  530.  
  531.     return;
  532.  
  533.  
  534. # ...................................................................
  535. # Put Ice Boss "into play"
  536. user1:
  537.  
  538.     # Initialize waypoint system for this section
  539.     for ( n_param = 0; n_param < n_wpnts; n_param = n_param + 1 )
  540.     {
  541.         AISetWpnt(t_wpnt00[n_param], n_param);
  542.     }
  543.  
  544.     AIConnectWpnts(0, 8);
  545.     AIConnectWpnts(8, 14);
  546.     AIConnectWpnts(14, 5);
  547.     AIConnectWpnts(5, 7);
  548.     AIConnectWpnts(7, 21);
  549.     AIConnectWpnts(21, 22);
  550.     AIConnectWpnts(21, 9);
  551.  
  552.     AIConnectWpnts(1, 0);
  553.     AIConnectWpnts(1, 2);
  554.     AIConnectWpnts(1, 3);
  555.     AIConnectWpnts(1, 4);
  556.  
  557.     AIConnectWpnts(2, 10);
  558.     AIConnectWpnts(10, 6);
  559.     AIConnectWpnts(6, 13);
  560.  
  561.     AIConnectWpnts(3, 20);
  562.     AIConnectWpnts(20, 16);
  563.     AIConnectWpnts(20, 18);
  564.     AIConnectWpnts(23, 5);
  565.  
  566.     AIConnectWpnts(4, 19);
  567.     AIConnectWpnts(19, 9);
  568.     AIConnectWpnts(9, 11);
  569.     AIConnectWpnts(11, 13);
  570.     AIConnectWpnts(13, 15);
  571.     AIConnectWpnts(15, 12);
  572.     AIConnectWpnts(12, 16);
  573.  
  574.     t_player        = GetLocalPlayerThing();                    # Initialize vars
  575.     n_marchToWpnt    = -1;
  576.     n_crntWpnt        = 1;
  577.     n_imp1Hits        = 0;
  578.  
  579.     f_val    = CheckFloorDistance(t_boss);
  580.     vec_pos    = GetThingPos(t_boss);
  581.     vec_pos    = VectorSet(VectorX(vec_pos), VectorY(vec_pos), VectorZ(vec_pos) - f_val);
  582.     SetThingPosEx(t_boss, vec_pos, FindNewSectorFromThing(t_boss, vec_pos));
  583.  
  584.     AIClearCutsceneMode(t_boss);
  585.  
  586.     SendMessage(GetThingClassCog(t_boss), USER1);                # Send "in play" msg along to class COG
  587.     SendMessageEx(GetInvCog(t_player, 14), USER0, 1, 0, 0, 0);    # Modify IMP1 shot range
  588.  
  589.     if ( b_testmode==1 )
  590.     {
  591.         SetActorFlags(t_boss, 0xC00);                            # DEAF and BLIND
  592.         AITraverseWpnts(t_boss, 1, 1.7, 0, 1);
  593.     }
  594.  
  595.     return;
  596.  
  597.  
  598. # ===================================================================
  599. #    Subroutines
  600. # ===================================================================
  601.  
  602. # ...................................................................
  603. Begin_GuardMarch:
  604.  
  605.     if ( n_marchToWpnt > -1 )
  606.     {
  607. #        DEBUGFLEX(n_marchToWpnt, "Begin_GuardMarch to wpnt");
  608.  
  609.         Reset();
  610.  
  611.         if ( !BITTEST(AIGetMode(t_boss), 0x200000) )            # Look to center if not wall crawling
  612.         {
  613.             AISetLookThingEyeLevel(t_boss, t_wpnt01);
  614.         }
  615.  
  616.         AIEnableInstinct(t_boss, "wallcrawl", 1);
  617.         AISetInstinctWpntMode(t_boss);
  618.         AISetSubMode(t_boss, 0x8000);                            # Set SUBMODE_CONTINUOUSWPNTMOTION
  619.         AIFleeToWpnt(t_boss, n_marchToWpnt);
  620.     }
  621.  
  622.     return;
  623.  
  624.  
  625. # ...................................................................
  626. End_GuardMarch:
  627.  
  628. #    DEBUGFLEX(n_marchToWpnt, "End_GuardMarch at wpnt");
  629.  
  630.     n_marchToWpnt = -1;
  631.     AIClearSubMode(t_boss, 0x8000);                                # Clear SUBMODE_CONTINUOUSWPNTMOTION
  632.     AIStopFlee(t_boss);
  633.     AISetFireTarget(t_boss, t_player);
  634.  
  635.     if ( BITTEST(AIGetMode(t_boss), 0x200000) )
  636.     {
  637.         PlaySoundClass(t_boss, 98);                                # Play 'roar' sound
  638.     }
  639.  
  640.     return;
  641.  
  642.  
  643. # ...................................................................
  644. Set_WallGuardMode:
  645.  
  646.     if ( BITTEST(AIGetMode(t_boss), 0x200000) )
  647.     {
  648. #        DEBUGPRINT("Set_WallGuardMode");
  649.  
  650.         AIEnableInstinct(t_boss, "wallcrawl", 0);                # Disable follow ability
  651.         AIClearInstinctWpntMode(t_boss);
  652.  
  653.         vec_pos = GetThingPos(t_boss);
  654.         vec_pos = VectorSet(VectorX(vec_pos), VectorY(vec_pos), VectorZ(GetThingPos(t_wpnt01)));
  655.         AISetLookPos(t_boss, vec_pos);
  656.     }
  657.  
  658.     return;
  659.  
  660.  
  661. end
  662.  
  663.